# -*- coding: utf-8 -*-
"""
@Time ： 2023/10/19 0:31
@Auth ： y.h
@File ：single_valued_matrix_calculation_properties.py
@IDE ：PyCharm
@Motto：The sooner you start to code, the longer the program will take. —— Roy Carlson
"""
from enum import Enum

import pandas





class 单值矩阵运算配置文件:
    __value = None

    __df = None
    __col_index = 0
    __row_begin_index = 0
    __row_end_index = 0

    __operator = None
    __is_value_calculation_table = False

    def get_value(self):
        return self.__value

    def 配置运算单值(self, value):
        self.__value = value
        return self

    def get_df(self):
        return self.__df

    def 配置数据集(self, df):
        if type(df) != type(pandas.DataFrame()):
            print(f"单值矩阵运算配置文件->配置数据集错误!,需要一个{type(pandas.DataFrame())},参数为{type(df)}")
            exit(True)
        else:
            self.__df = df
        return self

    def get_col_index(self):
        return self.__col_index

    def 配置索引列(self, col_index):
        if type(col_index) != type(int()):
            print(f"单值矩阵运算配置文件->配置索引列错误!,需要一个{type(int())},参数为{type(col_index)}")
            exit(True)
        else:
            self.__col_index = col_index
        return self

    def get_row_begin_index(self):
        return self.__row_begin_index

    def 配置数据集起始行(self, begin_index):
        if type(begin_index) != type(int()):
            print(f"单值矩阵运算配置文件->配置数据集起始行错误!,需要一个{type(int())},参数为{type(begin_index)}")
            exit(True)
        else:
            self.__row_begin_index = begin_index
        return self

    def get_row_end_index(self):
        return self.__row_end_index

    def 配置数据集截止行(self, end_index):
        if type(end_index) != type(int()):
            print(f"单值矩阵运算配置文件->配置数据集起始行错误!,需要一个{type(int())},参数为{type(end_index)}")
            exit(True)
        else:
            self.__row_end_index = end_index
        return self

    def get_operator(self):
        return self.__operator

    def 配置运算符(self, operator):

        self.__operator = operator
        return self

    def get_is_value_calculation_table(self):
        return self.__is_value_calculation_table

    def 单值运算矩阵(self,flag:bool):
        if type(flag) != type(bool()):
            print(f"{self}配置错误")
            exit(True)
        else:
            self.__is_value_calculation_table = flag
        return self
